# Copyright (c) 2013, 2015 Ruslan Baratov, Alexandre Pretyman
# All rights reserved.

cmake_minimum_required(VERSION 3.0)
project(Hunter)

list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules")

include("@HUNTER_SELF@/cmake/Hunter")

include(hunter_autotools_project)
include(hunter_report_broken_package)
include(hunter_status_debug)
include(hunter_assert_not_empty_string)

hunter_status_debug("Scheme: url_sha1_avahi_autotools")

if("@MSVC@")
  hunter_report_broken_package("Autotools scheme not supported with Visual Studio")
endif()

# Check preconditions
hunter_assert_not_empty_string("@HUNTER_SELF@")
hunter_assert_not_empty_string("@HUNTER_EP_NAME@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@")
hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@")

hunter_add_package(dbus)
hunter_add_package(Expat)
hunter_add_package(libdaemon)
hunter_add_package(intltool)

hunter_autotools_project("@HUNTER_EP_NAME@"
    HUNTER_SELF
      "@HUNTER_SELF@"
    URL
      @HUNTER_PACKAGE_URL@
    URL_HASH
      SHA1=@HUNTER_PACKAGE_SHA1@
    DOWNLOAD_DIR
      "@HUNTER_PACKAGE_DOWNLOAD_DIR@"
    SOURCE_DIR
      "@HUNTER_PACKAGE_SOURCE_DIR@"
    BUILD_DIR
      "@HUNTER_PACKAGE_BUILD_DIR@"
    INSTALL_DIR
      "@HUNTER_PACKAGE_INSTALL_PREFIX@"
    GLOBAL_INSTALL_DIR
      "@HUNTER_INSTALL_PREFIX@"
    PARALLEL_JOBS
      "@HUNTER_JOBS_OPTION@"
    PACKAGE_CONFIGURATION_TYPES
      "@HUNTER_PACKAGE_CONFIGURATION_TYPES@"
    EXTRA_FLAGS
      --disable-glib
      --disable-gobject
      --disable-qt3
      --disable-qt4
      --disable-gtk
      --disable-gtk3
      --disable-gdbm
      --disable-python
      --disable-mono
      --disable-monodoc
      --with-xml=expat
      --enable-compat-libdns_sd
)
